#include "nariDemo.h"

nariDemo::nariDemo(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
	this->setWindowTitle("一点通视频会议");
	this->setWindowIcon(QIcon(":/mainSouces/images/Qicon.jpg"));
	QImage image;
	image.load(":/mainSouces/images/mainWin.png");
	ui.mainLabel->setPixmap(QPixmap::fromImage(image));
	ui.modelPushButton->setStyleSheet("border:none;");
	ui.modelPushButton->setIconSize(QSize(20, 20));
	ui.modelPushButton->setIcon(QIcon(":/mainSouces/images/pwd_close.png"));
	ui.userLineEdit->setPlaceholderText("请输入用户名");
	ui.pwdLineEdit->setPlaceholderText("请输入用户密码");
	ui.pwdLineEdit->setEchoMode(QLineEdit::Password);
	this->bpwdLineEdit = false;//默认闭眼密文

}

nariDemo::~nariDemo()
{}

void nariDemo::on_modelPushButton_clicked()
{
	if (this->bpwdLineEdit)
	{
		ui.modelPushButton->setIconSize(QSize(20, 20));
		ui.modelPushButton->setIcon(QIcon(":/mainSouces/images/pwd_close.png"));
		ui.pwdLineEdit->setEchoMode(QLineEdit::Password);
		this->bpwdLineEdit = false;
	}
	else
	{
		ui.modelPushButton->setIconSize(QSize(20, 20));
		ui.modelPushButton->setIcon(QIcon(":/mainSouces/images/pwd_open.png"));
		ui.pwdLineEdit->setEchoMode(QLineEdit::Normal);
		this->bpwdLineEdit = true;
	}
	return;
}

void nariDemo::on_loginPushButton_clicked()
{
	QString strUser = ui.userLineEdit->text();
	QString strPwd = ui.pwdLineEdit->text();
	//if (strUser != "孔祥晨傻逼")
	//{
	//	QMessageBox::warning(this, "登录提示", "用户名错误请输入孔祥晨傻逼");
	//	return;
	//}
	//else if (strPwd != "521520")
	//{
	//	QMessageBox::warning(this, "登录提示", "用户密码错误请输入521520");
	//	return;
	//}
	this->hide();
	mainDialog * dialog = new mainDialog;
	dialog->show();

	return;
}